<?php
class TTF_Form_Contact extends Zend_Form
{
	public function init()
	{
		$this->setAction('/lien-he')
			->setMethod('post');
			
		// create new element
		$name = new Zend_Form_Element_Text('name');
		$name->setLabel('Họ tên (*):')
			->setRequired(true)
			->addFilter('HtmlEntities')
			->addFilter('StringTrim');
		
		// create new element
		$email = new Zend_Form_Element_Text('email');
		$email->setLabel('Email (*):')
				->setRequired(true)
				->addValidator('EmailAddress', true)
				->addFilter('HtmlEntities')
				->addFilter('StringTrim');
		
		// create new element
		$subject = new Zend_Form_Element_Text('subject');
		$subject->setLabel('Tiêu đề liên hệ (*):')
				->setRequired(true)
				->addFilter('HtmlEntities')
				->addFilter('StringTrim');
				
		// create new element
		$message = new Zend_Form_Element_Textarea('message');
		$message->setLabel('Nội dung liên hệ (*):')
				->setRequired(true)				
				->addFilter('HtmlEntities')
				->addFilter('StringTrim');
		
				
		// create new element
		$submit = new Zend_Form_Element_Submit('submit');
		$submit->setLabel('Gửi liên hệ');
		
		// attach the elements to the form
		$this->addElement($name)
			->addElement($email)
			->addElement($subject)
			->addElement($message)
			->addElement($submit);
	}
}